From f9f0de6a9c73eb3305bb52dfa483a5756b474f21 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 26 Jul 2005 17:24:22 +0000 Subject: [PATCH] Scrub initial xenstore page, free xendev structure. Signed-off-by: Rusty Russel Signed-off-by: Christian Limpach --- .../drivers/xen/xenbus/xenbus_comms.c | 3 +++ .../drivers/xen/xenbus/xenbus_probe.c | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c index 67146efea8..d402e81f53 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c @@ -202,6 +202,9 @@ int xb_init_comms(void **in, void **out) return err; } + /* FIXME zero out page -- domain builder should probably do this*/ + memset((void *)xen_start_info.store_page, 0, PAGE_SIZE); + *out = (void *)xen_start_info.store_page; *in = (void *)xen_start_info.store_page + PAGE_SIZE/2; return 0; diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c index d3aaa2f1e0..abdccc6fb9 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c @@ -150,6 +150,16 @@ struct xenbus_device *xenbus_device_find(const char *busid) return info.dev; } + +static void xenbus_release_device(struct device *dev) +{ + if (dev) { + struct xenbus_device *xendev = to_xenbus_device(dev); + + kfree(xendev->subtype); + kfree(xendev); + } +} /* devices// */ static int xenbus_probe_device(const char *dirpath, const char *devicetype, const char *name) @@ -176,6 +186,7 @@ static int xenbus_probe_device(const char *dirpath, const char *devicetype, /* FIXME: look for "subtype" field. */ snprintf(xendev->dev.bus_id, BUS_ID_SIZE, "%s-%s", devicetype, name); xendev->dev.bus = &xenbus_type; + xendev->dev.release = xenbus_release_device; /* Register with generic device framework. */ err = device_register(&xendev->dev); -- 2.30.2